# Maintainer: <waruqi@gmail.com>

_realname=xmake
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.8.2
pkgrel=1
pkgdesc="A cross-platform build utility based on Lua (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://github.com/xmake-io/xmake"
license=('spdx:Apache-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-ncurses"
         "${MINGW_PACKAGE_PREFIX}-readline")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("https://github.com/xmake-io/${_realname}/releases/download/v${pkgver}/${_realname}-v${pkgver}.tar.gz")
sha256sums=('ac0d3088bda466cfab39208b5c0697e747a92bd68bf967b815882bdbf4f144aa')

build() {
    cd "${_realname}-${pkgver}"
    ./configure --toolchain=${CC}
    make
}

package() {
    cd "${_realname}-${pkgver}"
    make install PREFIX="${pkgdir}${MINGW_PREFIX}"
    install -Dm644 "LICENSE.md" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.md"
}
